package com.example.mqspring.rabiitmqbasicleverone.rabbitmqDirectRoutkey;


import com.rabbitmq.client.Channel;

public class Producer {

    public void sendMessage(Channel channel,String Myexchange,String routkey,String message) throws Exception {

        channel.exchangeDeclare(Myexchange,"direct",false,false,null);
        channel.basicPublish(Myexchange,routkey,null,message.getBytes());
    }

}
